package com.wowoai.user.service;

import com.wowoai.common.userInfo.UserInfo;
import com.wowoai.user.controller.req.UserReq;
import com.wowoai.user.enums.UserScoreOptionTypeEnum;
import com.wowoai.user.service.dto.UserDTO;

/**
 * 用户的service
 */
public interface UserServiceI {
    /**
     * 根据电话号码查询用户信息
     * @param phoneNumber
     * @return
     */
    UserDTO getUserByPhoneNumber(String phoneNumber);

    UserDTO loginAndRegister(UserReq userReq);

    /**
     * 更新积分
     *
     * @param userDTO        用户信息
     * @param subtractScore  扣减的积分数
     * @param optionTypeEnum 操作类型
     * @param optionValue    操作值
     */
    void updateScore(UserDTO userDTO, Integer subtractScore, UserScoreOptionTypeEnum optionTypeEnum, String optionValue);

    void tipsSuccess(String phoneNumber);

    UserDTO getUserById(Long userId);

    UserDTO updateUserInfo(UserReq userReq, UserInfo userInfo);

    /**
     * 新增积分
     *
     * @param userInfo
     * @param score
     * @param permanentScore
     * @param userScoreOptionTypeEnum
     * @return
     */
    Boolean addScore(UserInfo userInfo, Integer score, Integer permanentScore, UserScoreOptionTypeEnum userScoreOptionTypeEnum);
}
